import axios from "../utils/request";

export interface getStudentPageData {
  username: string;
  password: string;
  role: string;
  remember: string;
  times: string;
}

export function getStudentPage(params: getStudentPageData) {
  return axios.post(`/api/Train/Index/login`, params);
}


export function apiindex() {
  const path = "/api/index/index";
  return axios.get(path);
}

export function loginGetAreas() {
  return axios.get("/api/login/getAreas");
}

// 验证码/
export function registercaptcha() {
  return axios.get("/api/register/captcha");
}

//获取机构信息
export function getOrgInfoData(code) {
  return axios.post("/api/register/getOrgInfo",{code});
}

// 登录/
// export interface loginlogindata {
//   username: string;
//   password: string;
//   captcha: string;
// }
// export function loginlogin(params: loginlogindata) {
//   return axios.post("/api/login/login", params);
// }

export interface postregisterdata {
  area: any;
  grade: string;
  realName: string;
  userName: string;
  captcha: string;
}
export function postregister(params: postregisterdata) {
  return axios.post("/api/register/register", params);
}

// 获取地区数据
export function getregisterAreas() {
  return axios.get("/api/register/getAreas");
}
// /api/login/getGrade 年级
export function logingetGrade() {
    return axios.get("/api/register/getGrade");
  }// 全域配置
export function getConfig() {
    return axios.get("/api/setting/getConfig");
  }